USE CX_DB_Live
GO
--as SMK is instance based, it may be possible that
--you are trying to restore database in different instance
ALTER MASTER KEY DROP ENCRYPTION BY SERVICE MASTER KEY;

--again opening master key before taking up backup
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'cxVirtualDmKey'

Declare @strCXDBLiveDate varchar(200)
Set @strCXDBLiveDate = N'E:\CX_DB_Backup\CX_DB\CX_DB_Live_188@' + Convert(varchar(112), GetDate(), 112) + '_3_30_AM' + '.bak' 
BACKUP DATABASE [CX_DB_Live] TO  DISK = @strCXDBLiveDate  WITH NOFORMAT, NOINIT,  NAME = N'CX DB Live 188 Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
--==========================================================================================================================
USE [master]

Declare @strCXDBProviderLogDate varchar(200)
Set @strCXDBProviderLogDate = N'E:\CX_DB_Backup\CX_DB\CX_DB_Provider_Log_Live_188@' + Convert(varchar(112), GetDate(), 112) + '_3_30_AM' + '.bak' 
BACKUP DATABASE [CX_DB_Provider_Log_Live] TO  DISK = @strCXDBProviderLogDate  WITH NOFORMAT, NOINIT,  NAME = N'CX DB Provider Log Live 188 Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

--==============================================================================================================================
Declare @strCXDBReportDate varchar(200)
Set @strCXDBReportDate = N'E:\CX_DB_Backup\CX_DB\CX_DB_Report_188@' + Convert(varchar(112), GetDate(), 112) + '_3_30_AM' + '.bak' 
BACKUP DATABASE [CX_DB_Report] TO  DISK = @strCXDBReportDate  WITH NOFORMAT, NOINIT,  NAME = N'CX DB Report 188 Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
--==============================================================================================================================

Declare @strCXDBPaymentDate varchar(200)
Set @strCXDBPaymentDate = N'E:\CX_DB_Backup\CX_DB\CX_DB_Payment_188@' + Convert(varchar(112), GetDate(), 112) + '_3_30_AM' + '.bak' 
BACKUP DATABASE [CX_DB_Payment_Live] TO  DISK = @strCXDBPaymentDate  WITH NOFORMAT, NOINIT,  NAME = N'CX DB Payment 188 Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
--==============================================================================================================================

